package com.hsp.demo_01;

import java.util.Scanner;

public class Demo_05 {
    public static void main(String[] args) {

        double ticketPrice = 60.0;
        double ticketPrice2 = 40.0;

        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入月份：");
        int month = scanner.nextInt();
        if (month >= 1 && month <= 12) {
            Scanner scanner1 = new Scanner(System.in);
            System.out.print("请输入年龄：");
            int age = scanner1.nextInt();
            if (age >= 0) {
                if (month >= 4 && month <= 10) {

                    if (age < 18) {
                        System.out.println("票价为：" + ticketPrice / 2);
                    } else if (age >= 18 && age < 60) {
                        System.out.println("票价为：" + ticketPrice);
                    } else {
                        System.out.println("票价为：" + ticketPrice / 3);
                    }

                } else {
                    if (age >= 18 && age < 60) {
                        System.out.println("票价为：" + ticketPrice2);
                    } else {
                        System.out.println("票价为：" + ticketPrice2 / 2);
                    }
                }
            } else {
                System.out.println("年龄必须大于等于0！");
            }
        } else {
            System.out.println("月份输入有误，必须在1-12之间的整数！");
        }

    }
}
